/**
 * 
 */
package com.feonix.datastructure.btree;

/**
 * @CopyRight (c)1993-2017
 * @Project common_practice
 * @Comments 请输入该类的描述
 * @NameSpace com.feonix.datastructure
 * @Author Feonixzw
 * @CreateDate 2018年2月7日
 */
public class TreeNode {
	//值
	private int value;
	
	//左子树
	private TreeNode leftNode;
	
	//右子树
	private TreeNode rightNode;
	
	public int getMaxDepth(TreeNode treeNode){
		if(treeNode == null){
			return 0;
		}
		int left = getMaxDepth(treeNode.leftNode);
		int right = getMaxDepth(treeNode.rightNode);
		return Math.max(left, right) + 1;
	}
	

}
